Method for operating a cache memory, cache memory and processing unit

ABSTRACT

A method for operating a cache memory having a set having multiple memory blocks configured for storing data blocks. In a write process of a data block into a memory block of the set, the data block is written into the memory block, a relevance rank value of the data block and a first access time rank value are determined. Rank data associated with the memory block are determined using a write rank mapping from the relevance rank value and the first access time rank value, and the determined rank data are stored. If no memory block of the set is free, a memory block that is to be overwritten is selected from the memory blocks of the set based on the rank data, which are associated with the memory blocks, and the data block to be stored is written into the selected memory block by using the write process.

CROSS REFERENCE

The present application claims the benefit under 35 U.S.C. § 119 of German Patent Application No. DE 10 2021 209 321.3 filed on Aug. 25, 2021, which is expressly incorporated herein by reference in its entirety.

FIELD

The present invention relates to a method for operating a cache memory, to a cache memory and to a processing unit.

BACKGROUND INFORMATION

Microprocessors may comprise a cache memory or temporary storage or may be connected to one, in which data, which are stored in a main memory (e.g., a working memory), may be stored temporarily, in order to be able to access these more quickly in the event that these data are required again. Usually, the cache memory has a higher clock frequency, a greater memory bandwidth and/or a lower latency than the main memory and is markedly smaller than the main memory due to the associated more elaborate manufacture.

SUMMARY

According to the present invention, a method for operating a cache memory, a cache memory and a processing unit are provided. Advantageous developments of the present invention are disclosed herein.

When determining memory blocks in the cache memory that are to be overwritten, an example embodiment of the present invention makes us of the measure of taking into account, in addition to the access time (i.e., the time of the access), a relevance, encoded as a relevance rank value, of the data blocks stored therein. This makes it possible to increase the probability of a cache hit and thereby increase the execution speed of computer programs as compared to taking only the access time into account, since data blocks, which contain data, which are likely or with greater probability accessed repeatedly in the program execution, may be assigned a higher relevance than other data blocks. In particular, an unfavorable cache behavior may be suppressed by time-critical applications.

In detail, according to an example embodiment of the present invention, the method for operating a cache memory, which includes at least one set of multiple memory blocks configured for storing data blocks, provides that in a process of writing a data block into a memory block of the set (i.e., in a cache write access), the data block is written into the memory block, that a relevance rank value of the data block and a first access time rank value are determined, that rank data associated with the memory block are determined by way of a write rank mapping from the relevance rank value and the first access time rank value, and that the rank data associated with the memory block are stored. If no memory block of the set is free, a memory block to be overwritten is selected from the memory blocks of the set on the basis of the rank data associated with the memory blocks, and the data block to be stored is written into the selected memory block by using the write process. This thus implies replacing the data blocks stored in a cache memory with new data blocks. If a memory block is free, the data block to be stored is expediently written into the free memory block. If multiple memory blocks are free or unoccupied, any one of these memory blocks may be selected (if applicable, by taking into account the associativity). It is essential that here too the write process, in which rank data are determined and stored, is used.

The term “cache memory” or “buffer memory” denotes a temporary storage associated with a processor, in which data, which are stored in a main memory (which is slow compared to the cache memory), may be stored temporarily, so that these may be accessed by the processor more quickly if they are required again. The term “memory block” or “cache block” denotes a section of the cache memory or of the set, which corresponds in its size to the data blocks, which are accessed jointly in the main memory. This size, or at least the minimum size, is determined essentially by the memory bus width of the main memory. Instead of the term “memory block” or “cache block”, it is also possible to use the term “cache line”. Multiple memory blocks are combined into a “set” or “cache set”, also called a “cache group”, which is associated with a section of the main memory, i.e., data blocks in this section are stored in the associated set.

The relevance rank value may be regarded as a value that indicates to what extent a longer or shorter storage of the data block in the cache memory is decisive for the execution speed of a computer program that comprises this data block or accesses it. The relevance rank value may be an arbitrary number or more generally also multiple numbers. The set of different relevance rank values is preferably finite and is given in particular by a subset of the integers or of the natural numbers, e.g., {0, 1, 2, . . . , M−1}. Further preferably, the number M, for example M=2 or M=4, of different relevance rank values is a power of 2, i.e., M=2^(N) for an integer N, so that the relevance rank values may be encoded and stored efficiently as N bit patterns.

According to an example embodiment of the present invention, in order to store the relevance rank values, a relevance field may be provided for a data block in a page table entry in a page table, which assigns physical memory addresses (i.e., actual memory addresses of the main memory) to logical memory addresses (i.e., memory addresses in a virtual address space from the perspective of the processor or of a program), in which the relevance rank value of the data block is stored or may be stored. Alternatively, it may be provided that page table entries only have categorization fields (e.g., one bit), in which a value indicates whether a relevance rank value exists for the respective data block. The relevance rank values for data blocks, for which a relevance rank value exists, may then be stored in a relevance table or relevance list. For data blocks, for which no relevance rank value exists, a standard relevance rank value may be used. For the page table and, if indicated, for the relevance table or relevance list, a separate buffer memory is preferably provided, which may also be contained in the cache memory, in particular in its control unit. In the event of memory accesses, these additional fields in the page table entries and, if indicated, the relevance table or relevance list may be read and the corresponding relevance rank values may be used in the method.

The first/second access time rank value corresponds to the time, at which the last cache access of the memory block occurred, or to the placement of the respective cache access in a time series of cache accesses. Here, as above, the term “cache access” is to include both cache write accesses or write accesses as well as, as below, cache read accesses. Cache accesses may be numbered in accordance with their time sequence for example, the access time rank value of a cache access being the number of this cache access in accordance with the numbering.

Both the relevance rank value as well as the access time rank value may comprise multiple individual values (e.g., numerical values). These terms are thus to be understood generally as “at least one relevance rank value” and “at least one access time rank value”, respectively.

According to an example embodiment of the present invention, in a cache read access, in which a stored data block is read out of a memory block of the set, the relevance rank value of the data block to be read and a second access time rank value are preferably determined, rank data assigned anew to the memory block are determined by way of a read rank mapping from the relevance rank value and the second access time rank value, and the newly determined rank data associated with the memory block are stored. The read rank mapping is preferably identical to the write rank mapping. A cache read access to the cache memory occurs when a cache hit occurs, i.e., requested data (requested by a processor for example) are contained in a data block, which is stored in a memory block of the set. The requested data may then be read out of this memory block without having to access a main memory, which contains the data to be stored temporarily in the cache memory.

The rank data preferably comprise a combined rank value, a combination function being applied to the relevance rank value and the first and second access time rank value, respectively, in order to determine the combined rank value. Preferably, a memory block of the set that has the lowest combined rank value is selected as the memory block to be overwritten or a memory block of the set that has the highest modified combined rank value is selected as the memory block to be overwritten.

According to an example embodiment of the present invention, the determination of the combined rank value may be part of the write rank mapping and/or of the read rank mapping, it being possible to provide different combination functions for the write rank mapping and the read rank mapping. The formation of combined rank values is advantageous since these may be evaluated without great effort and therefore quickly. If the relevance rank value is denoted by P, the access time rank value by R, the modified access time rank value by R_(comb) and the relevance function by g, then R_(comb)=g(P, R).

According to an example embodiment of the present invention, the rank data preferably comprise a modified access time rank value, a relevance function being applied to the relevance rank value and the result being used to determine the modified access time rank value by computation with the access time rank value, e.g., by addition, subtraction, multiplication or division. Preferably, a memory block of the set that has the lowest modified access time rank value is selected as the memory block to be overwritten or a memory block of the set that has the highest modified access time rank value is selected as the memory block to be overwritten.

The determination of the modified access time rank value is part of the write rank mapping and/or of the read rank mapping, it being possible to provide different relevance functions for the write rank mapping and the read rank mapping. In the following example of a linear function, the constant a could be chosen to be greater in terms of absolute value in the case of a read rank mapping than in the case of a write rank mapping in order to take into account that a data block, for which a cache hit occurs, will be required again later with greater probability.

If the relevance rank value is denoted by P, the access time rank value by R, the modified access time rank value by R_(mod) and the relevance function by f, then R_(mod)=f(P)+R. In the value range of the relevance rank values, the relevance function should should be monotonically increasing (or decreasing). In this context, linear, quadratic etc. functions or also other functional dependencies are possible. Thus, in the case of a linear function, f(P)=a·P+b; with real constants a, b; for example f(P)=6·P−1, so that R_(mod)=6·P−1+R. Furthermore, depending on the relevance rank value, various functional dependencies are also possible. For example, for data blocks having a relevance rank value P equal to 0, the modified access time rank value R_(mod) could be equal to the access time rank value R (R_(mod)=R, für P=0), and for data blocks having the relevance rank value P unequal to 0, a function as mentioned above could be applied (R_(mod)=f(P)+R, for P≠0).

Whether the memory block having the lowest combined or modified rank value or the memory block having the highest combined or modified rank value is selected as the memory block to be overwritten depends on the encoding, i.e., in which direction (ascending or descending) the combined or modified rank values indicate that the respective memory block should not be overwritten. If the access time rank value R is for example an ascending numbering of cache accesses, then the memory block having the lowest modified rank value is selected.

In both of the aforementioned variants, if multiple memory blocks of the set have the same lowest or the same highest combined or modified access time rank value, it is preferably possible to select the memory block of these multiple memory blocks as the memory block to be overwritten, which has the lowest relevance rank value, or the one that has the highest relevance rank value.

According to an example embodiment of the present invention, the rank data preferably comprise a step value, the step value being determined in the write process based on the relevance rank value of the data block to be written, the step value being changed after respectively a specific number of cache write accesses and/or cache read accesses. Preferably, following the specific number of cache write accesses and/or cache read accesses, the step value is reduced or increased and a memory block that has the lowest step value is selected as the memory block to be overwritten or a memory block that has the highest step value is selected as the memory block to be overwritten. Further preferably, the rank data comprise the access time rank value and, if multiple memory blocks have the lowest or the highest step value, the memory block is selected as the memory block to be overwritten that has the lowest access time rank value or, respectively, that has the highest access time rank value. For example, step values 0, 1, . . . , S may be provided, wherein, if a data block is to be overwritten, the occupied memory block is selected that has the lowest step value and, if multiple memory blocks have the same step value, the memory block from among these is selected that has the lowest access time rank value. For this variant, the rank data may be stored e.g., as lists, a list being provided for each step value, in which the memory blocks (or addresses of the memory blocks in the set) having this step value and the corresponding access time rank values are indicated. Following the specified or determined number of cache accesses, the step value of all memory blocks is lowered by one. In the case of a cache hit or cache read access, the rank data (i.e., step value and access time rank value) of the read memory block may be determined and updated anew, i.e., this memory block is again categorized at a higher step value if more than the determined number of cache accesses since the last access to this memory block have come to pass.

Preferably, in the case of cache write accesses and/or in the case of cache read accesses, the respectively associated rank data of one or multiple memory blocks not affected by the cache access are updated. For this purpose, an update rank mapping may be used, which may be a function of the old rank data, the relevance rank values and/or the access time rank values and which maps these onto the updated rank data, which are then stored. An update may involve, e.g., a change of combined or modified access time rank values or, if the rank data encode a relative priority of the memory blocks, an update of these relative priorities. Relative priorities are expedient, since these may be stored efficiently in bit patterns. If a set comprises four memory blocks for example, then two bits per memory block suffice for the encoding.

The present invention preferably comprises a determination of the relevance rank values for data blocks, at least one computer program, which comprises the data blocks or access these, being executed repeatedly by a processor connected to the cache memory, and execution times being measured, it being possible for one or multiple data blocks to be tested to be selectively excluded from storage in the cache memory or, after an initial storage in the cache memory, to be prevented from being deleted from the latter for a specified number of memory accesses, in order to determine the relevance rank values of these data blocks to be tested based on the execution times. A higher relevance and a corresponding relevance rank value may be assigned to tested data blocks, which, in the event that they cannot be deleted from the cache for the specified number of memory accesses, result in shorter execution times.

Data blocks that are not tested may be assigned a standard relevance rank value, in particular one corresponding to a low relevance. Alternatively, untested data blocks may be identified as “without relevance rank value”, which is then taken into account by the write and/or read rank mapping. Tested data blocks may likewise be identified as “with relevance rank value”. Altogether, only one bit (“without relevance rank value”/“with relevance rank value”) is necessary for identifying the data blocks, a table or list (relevance table or relevance list) with the corresponding relevance rank values being additionally provided for those data blocks “with relevance rank value”. To save time, it is thus not necessary to test all data blocks that comprise program data. The data blocks to be tested may be selected by one skilled in the art on the basis of the structure of the computer program with which he is familiar. It is also possible, however, initially to observe memory accesses to the main memory in the program execution, and then to select data blocks to be tested from areas of the main memory that are accessed relatively often.

Accordingly, according to an example embodiment of the present invention, the method furthermore preferably comprises an update of page table entries in order to store the determined relevance rank values; wherein, in a relevance field of a page table entry that refers to a tested data block, the determined relevance rank value for this data block is stored. Alternatively, in a classification field of a page table entry, which refers to a tested data block, a value is stored that indicates that a relevance rank value was determined for this data block, and the relevance rank value determined for this data block is stored in a relevance table or relevance list. The classification field may correspond to the bit (“without relevance rank value”/“with relevance rank value”). For data blocks, for which no relevance rank value was determined, a corresponding value (“without relevance rank value”) may be stored in the classification field; this may be a standard entry for example. It is only necessary to produce entries for data blocks, for which a relevance rank value was determined and is stored (“with relevance rank value”), in the relevance table or relevance list, so that memory space may be saved if a relevance rank value is determined only for a portion of the data blocks.

A cache memory according to the present invention comprises at least one set of multiple memory blocks, which are configured to store data blocks, and a control unit, which is configured to carry out a method according to example embodiment(s) of the present invention.

According to an example embodiment of the present invention, the cache memory preferably comprises a rank data memory area, which is configured to store the rank data. The rank data memory area may be part of a management data memory area, in which data are stored that concern the data blocks temporarily stored in the memory blocks of the cache memory, e.g., which data block (i.e., its address in the main memory) is stored in a memory block, or whether it was overwritten by the processor (“dirty tag”), and the like. The rank data memory area is not necessarily a contiguous memory area, but rather an entry (which typically comprises several bytes) may be provided for each memory block in the management data memory area, which also comprises the rank data for this memory block.

A processing unit according to an example embodiment of the present invention comprises a processor, a main memory and a cache memory according to the present invention, which is configured temporarily to store data blocks stored in the main memory.

Additional advantages and developments of the present invention derive from the description and the figures.

The present invention is represented schematically in the figures on the basis of exemplary embodiments and described below with reference to the figures.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows a processing unit having a cache memory according to a preferred specific embodiment of the present invention.

FIG. 2 shows a flow chart of a memory access, a cache memory being accessed in accordance with preferred specific embodiments of the present invention.

DETAILED DESCRIPTION OF EXAMPLE EMBODIMENTS

FIG. 1 shows a processing unit 2 having a cache memory 10 according to a preferred specific embodiment of the present invention. The processing unit 2 comprises a processor 4, which is designed to execute computer programs that are stored in a main memory 6 (working memory). A cache memory 10 is provided in order to accelerate access to the main memory 6. Cache memory 10 comprises a data block memory area 12, a control unit 14 and a rank data memory area 16.

The data block memory area 12 is configured temporarily to store data blocks, which are stored in the main memory 6 and are read by processor 4, in order to be able to access these more quickly if they are again requested by processor 4. The data block memory area 12 comprises or is organized in at least one set 18 having multiple memory blocks 20, it being possible for one data block to be stored in each memory block. A size of a memory block or data block may in principle be selected arbitrarily in accordance with the requirements or conditions of the main memory and/or processor architecture used. The size may be, e.g., 16 bytes, 32 bytes, 64 bytes or 128 bytes etc. The set 18 serves to store temporarily data blocks, which are stored in a specific section 8 of the main memory 6 associated with set 18. As an alternative to what is presented here, the section associated with the set may also be non-contiguous, i.e., it may be made up of multiple partial sections distributed across the main memory. Different sets are associated with different sections of the main memory, that is, every data block stored in the main memory may be temporarily stored in precisely one of the sets. The size of the main memory sections is many times greater than the size of the sets, e.g., the number of data blocks in a main memory section 8 may be greater by several orders of magnitude (e.g., 10³ to 10⁶) than the number of memory blocks in a set (this corresponds to the size ratio of the main memory to the data block memory area). The number of memory blocks in a set known as associativity may as such be an arbitrary number, e.g., 2, 4, 8, 16 etc. A fully associative variant, i.e., there is only one set that includes all memory blocks, is also possible.

The control unit 14 is used to control the cache memory 10. This includes on the one hand the data communication with the processor 4 and the main memory 6. On the other hand, control unit 14 is configured to carry out a method according to the present invention. The utilized rank data are stored in the rank data memory area 16. The rank data memory area 16 may be part of a memory area (not shown), in which management data regarding the data blocks stored in the memory blocks are stored; to this extent, the rank data may be regarded as management data or may be comprised by the latter.

The processor 4 and the cache memory 10 are represented here as separate elements for illustrative purposes, it being possible for the data communication between the cache memory and the main memory to occur directly or indirectly (via the processor). Preferably, however, cache memory 10 is part of processor 4, it being possible for the control unit 14 of cache memory 10 to be part of a memory control of processor 4. It is also possible that the cache memory and the main memory are provided in a memory device, e.g., in a hard disk drive or a solid state drive, which is connected to the processor, which may also be contained in a processing unit separate from the memory device, via a data interface, e.g., PCIe, USB or SATA.

FIG. 2 shows a flow chart of a memory access, a cache memory being accessed in accordance with preferred specific embodiments of the present invention. The general sequence of the memory access is illustrated, which also includes steps that are optional. In particular, steps 110, 120, 130, 140 refer to such instances.

In step 110, data are requested (for example by the processor), which are stored at a specific memory address in the main memory. In step 120, a check is performed (by the control unit of the cache memory) to determine whether the data block, in which the memory address is contained, is stored in a memory block of a corresponding set of the cache memory. If this is the case, then the data are read out of the cache memory in step 130 (see also steps 220, 230, 240 further below), and, if this is not the case, the data are read out of the main memory in step 140.

When the data in step 140 are read out of the main memory, the data or the data block, within which they are contained, may be stored in the cache memory. This represents a cache write access. For this purpose, a check is first performed in step 150 to determine whether a memory block is free or unoccupied in the set that is assigned to the data or the data block, in which these are contained. If this is the case, this free memory block is selected in step 160 (if several memory blocks in the set are free, one of these several is selected) and the system proceeds to write the data block into the selected memory block. This writing or this writing process 165 comprises the steps 170, 180, 190, 200.

In step 170, the data block to be stored is written into the memory block. The writing of the data block to be stored into the memory block may be performed independently of the further steps 180 (determining the relevance and access time rank values), 190 (determining the rank data), 200 (writing the rank data), prior to, following, between or even in parallel to these steps.

In step 180, a relevance rank value of the data block to be stored, i.e., a value that indicates the priority with which the data block is to held in reserve in the cache, and a first access time rank value, i.e., a value that characterizes the time of the write access, is determined.

In step 190, rank data (which are assigned to the memory block, into which the data block is written) are determined from the relevance rank value and the first access time rank value. The rank data represent a combined rank value. In order to determine the rank data, a write rank mapping is used, i.e., a mapping or function that assigns the rank data to each pair of relevance rank value and access time rank value. The write rank mapping may depend on the rank data, relevance rank values and/or access time rank values of other memory blocks or of the data blocks stored therein, e.g., if the rank data describe merely a ranking of the memory blocks in the set.

In step 200, the rank data are stored, e.g., are written into the rank data memory area.

Returning to step 150, if it is determined that no memory block in the set (which is assigned to the data or the data block, in which these are contained) is unoccupied or free, a memory block of the set that is to be overwritten is selected in step 210. This selection occurs on the basis of the rank data, which are assigned to the memory blocks enclosed in the set, i.e., the memory block is selected, whose rank data indicate the lowest priority of a further temporary storage. For which memory block this is the case is determined by the rank data, which encode this “priority”; typically, the rank data comprise at least one value, the memory block, for which this value is the greatest or the smallest, being selected. The rank data may be provided, e.g., as a modified access time rank value or may comprise such, the memory block having the oldest modified access time (lowest or highest access time rank value) being then selected, it being possible to take other aspects (e.g., encoded in the rank data) into account, for example if two memory blocks have the same modified access time rank value.

When the data are read out of the cache memory in step 130, the rank data of the memory block, in which the respective data block is stored, may be updated upon reading. This occurs in the steps 220, 230 and 240, which essentially correspond to the steps 180, 190 and 200.

In step 220, the relevance rank value of the data block to be read and a second access time rank value (the second access time rank value refers to the cache read access, in contrast to the first access time rank value, which refers to the cache write access) are determined.

In step 230, rank data associated with the memory block are determined anew by way of a read rank mapping from the relevance rank value and the second access time rank value. Read rank mapping may be identical to write rank mapping or may differ from the latter, it being possible for example to take into account that a cache hit already occurred for the data block.

In step 240, the rank data newly determined in step 230, which are assigned to the memory block, are stored (e.g., in the rank data memory area, by overwriting the old rank data).

In both cases, i.e., in a cache read access (steps 130, 220, 230, 240) and in a cache write access (steps 140 to 210), the rank data of memory blocks, which were not accessed may optionally also be newly determined or updated. This may be provided especially when the rank data encode a relative priority of the memory blocks. Thus, in step 250, the (stored) rank data of memory blocks of the set, which are not accessed (neither by reading nor by writing), are preferably updated. For this purpose, an update mapping may be used, which is applied to the stored rank data and which may also depend on the relevance rank values of the respective data blocks, in order to determine the rank data anew. The newly determined rank data may then be stored, e.g., by overwriting the old rank data.

Furthermore, a determination of the relevance rank values for data blocks may preferably occur in step 100 (in preparatory fashion). For this purpose, multiple execution times of a computer program or of parts of a computer program may be measured, wherein, respectively, for the purpose of measuring different execution times, data blocks to be tested (these are data blocks, in which the computer program is stored or which it accesses) are selectively excluded from temporary storage in the cache or, if they are accessed, are kept in reserve in the cache memory for a specified number of memory accesses (that is, are not deleted). By comparing the execution times, the respective relevance of the corresponding data blocks to be tested may be inferred. The determination of the relevance rank values occurs preferably prior to the implementation of the method (in the regular computer program execution), but may also be carried out in parallel to it, in that different relevance rank values are assigned to each data block to be tested, for example in repeated program execution, and associated execution times are recorded. 

What is claimed is:
 1. A method for operating a cache memory, which includes at least one set having multiple memory blocks configured for storing data blocks, the method comprising the following steps: in a write process of a data block into a memory block of the set: writing the data block into the memory block, determining a relevance rank value of the data block and a first access time rank value, determining rank data associated with the memory block using a write rank mapping from the relevance rank value and the first access time rank value, and storing the determined rank data associated with the memory block; when no memory block of the set is free: selecting a memory block to be overwritten from the memory blocks of the set based on the rank data that are associated with the memory blocks, and writing the data block to be stored into the selected memory block by using the write process.
 2. The method as recited in claim 1, further comprising: in a cache read access, in which a stored data block is read out of a memory block of the set: determining the relevance rank value of the data block to be read and a second access time rank value, determining anew rank data associated with the memory block using a read rank mapping from the relevance rank value of the data block to be read and the second access time rank value, and storing the new determined rank data associated with the memory block to be read.
 3. The method as recited in claim 2, wherein the read rank mapping is identical to the write rank mapping.
 4. The method as recited in claim 1, wherein, when at least one memory block of the set is free, in a cache write access in which a data block to be stored is to be stored in the set, the at least one free memory block is selected, and the data block to be stored is written into the at least one free memory block by using the write process.
 5. The method as recited in claim 2, the rank data includes a combined rank value, a combination function being applied to the relevance rank value and the first or, respectively, second access time rank value, in order to determine the combined rank value, a memory block, which has the lowest combined rank value, being selected as the memory block to be overwritten or a memory block, which has the highest modified combined rank value being selected as the memory block to be overwritten.
 6. The method as recited in claim 1, wherein the rank data includes a modified access time rank value, a relevance function being applied to the relevance rank value and a result of the relevance function being used to determine the modified access time rank value by computation with the access time rank value.
 7. The method as recited in claim 6, wherein, a memory block of the set that has a lowest modified access time rank value is selected as the memory block to be overwritten or a memory block of the set that has a highest modified access time rank value is selected as the memory block to be overwritten.
 8. The method as recited in claim 6, wherein, when multiple memory blocks of the set have the same lowest or the same highest combined or modified access time rank value, a memory block of the multiple memory blocks is selected as the memory block to be overwritten, which has a lowest relevance rank value, or has a highest relevance rank value.
 9. The method as recited in claim 1, wherein the rank data includes a step value, the step value being determined in the write process based on the relevance rank value of the data block to be written, and wherein the step value is changed after respectively a specific number of cache write accesses and/or cache read accesses.
 10. The method as recited in claim 9, wherein, following the specific number of cache write accesses and/or cache read accesses, the step value is reduced or increased and a memory block of the set that has a lowest step value is selected as the memory block of the set to be overwritten or a memory block that has a highest step value is selected as the memory block to be overwritten; and wherein the rank data include the access time rank value and, when multiple memory blocks have the lowest or the highest step value, the memory block is selected as the memory block to be overwritten that has a lowest access time rank value or that has a highest access time rank value.
 11. The method as recited in claim 1, wherein, in the case of cache write accesses and/or in the case of cache read accesses, the respectively associated rank data of one or multiple memory blocks not affected by the cache access are updated.
 12. The method as recited in claim 1, wherein, for determining the relevance rank values for data blocks, at least one computer program, which includes the data blocks or accesses the data blocks, being executed repeatedly by a processor connected to the cache memory, and execution times being measured, one or multiple data blocks to be tested being selectively excluded from storage in the cache memory or, after an initial storage in the cache memory, the one or multiple data blocks being prevented from being deleted from the cache memory for a specified number of memory accesses, to determine the relevance rank values of the data blocks to be tested based on the execution times.
 13. The method as recited in claim 12, further comprising: supplementing page table entries in order to store the determined relevance rank values; wherein: (i) in a relevance field of a page table entry, which refers to a tested data block, the determined relevance rank value for the data block is stored, or (ii) in a classification field of a page table entry, which refers to a tested data block, a value is stored that indicates that a relevance rank value was determined for the data block, and the relevance rank value determined for this data block is stored in a relevance table or a relevance list.
 14. A cache memory, comprising: at least one set having multiple memory blocks, which are configured to store data blocks; and a processing unit configured to: in a write process of a data block into a memory block of the set, the processing unit configured to: write the data block into the memory block, determine a relevance rank value of the data block and a first access time rank value, determine rank data associated with the memory block using a write rank mapping from the relevance rank value and the first access time rank value, and store the determined rank data associated with the memory block; when no memory block of the set is free: select a memory block to be overwritten from the memory blocks of the set based on the rank data that are associated with the memory blocks, and write the data block to be stored into the selected memory block by using the write process.
 15. The cache memory as recited in claim 14, further comprising a rank data memory, which is configured to store the rank data.
 16. A processing unit, comprising: a processor; a main memory; and a cache memory configured temporarily to store data blocks stored in the main memory, wherein the cache memory includes: at least one set having multiple memory blocks, which are configured to store data blocks; and a processing unit configured to: in a write process of a data block into a memory block of the set, the processing unit configured to: write the data block into the memory block, determine a relevance rank value of the data block and a first access time rank value, determine rank data associated with the memory block using a write rank mapping from the relevance rank value and the first access time rank value, and store the determined rank data associated with the memory block; when no memory block of the set is free: select a memory block to be overwritten from the memory blocks of the set based on the rank data that are associated with the memory blocks, and write the data block to be stored into the selected memory block by using the write process. 